package cn.s1995.sloth.bizs.mapper;

import cn.s1995.sloth.common.data.datascope.SlothBaseMapper;
import cn.s1995.sloth.bizs.entity.Sku;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Map;

@Mapper
public interface SkuMapper extends SlothBaseMapper<Sku> {


    /**
     * 更新sku库存
     * @param sku
     * @return
     */
    int updateStocks(@Param("sku") Sku sku);

    /**
     * 归还sku库存
     * @param collect
     */
    void returnStock(@Param("collect") Map<Long, Integer> collect);
}
